package adminRole

import (
	"grpc.getaway.adminspro.padmins.com/internal/api/module/admin/container"
	"grpc.getaway.adminspro.padmins.com/internal/api/utils/rpc"
	pbAdmin "grpc.getaway.adminspro.padmins.com/pkg/proto/admin"
	"strconv"
)

func Resource(c *container.Context) (interface{}, error) {

	id, _ := strconv.ParseInt(c.Request.ParamsToString("id"), 10, 64)
	pid, _ := strconv.ParseInt(c.Request.ParamsToString("pid"), 10, 64)

	req := &pbAdmin.AdminRoleResourceReq{
		Id:  id,
		Pid: pid,
	}

	return rpc.GetAdminClient().AdminRoleResource(c.GetContext(), req)
}
